package com.wn.search.controller;

import com.wn.common.model.dto.BorrowSearchDTO;
import com.wn.common.result.Result;
import com.wn.search.bean.Page;
import com.wn.search.service.IBorrowService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yellow Docter
 * @date 2023 -08-02
 * @desc
 */
@RestController
@RequestMapping("search")
public class SearchController {

    @Autowired
    private IBorrowService borrowService;

    @ApiOperation("搜索借款记录")
    @PostMapping("borrow")
    public Result searchBorrowRecord(@RequestBody BorrowSearchDTO borrowSearchDTO){
        Page page = borrowService.searchBorrowRecord(borrowSearchDTO);
        return Result.ok("查询成功",page);
    }

}
